UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ZRl2BWzf6Z6AAEAVoEKn9Mhx0veE9ONtvI9KGNbbxuA=' 
WHERE 
  key_id = '108debb6d4271c1461fd4338f53100f295634a9bc3344a10740e384780e27d31' 
  AND (
    token = 'ZRl2BWzf6Z6AAEAVoEKn9Mhx0veE9ONtvI9KGNbbxuA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00019