UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'zvWAp8VsNgsBLf8+opzx/GtzD33neYncE56En0RrRyM=' 
WHERE 
  key_id = '14cd92436be12df6ee1a694b91c86f631f85b5c231ce07d7609bbd26a6e66a27' 
  AND (
    token = 'zvWAp8VsNgsBLf8+opzx/GtzD33neYncE56En0RrRyM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00052