UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'BVAUQRfc01srSCen/dHJux417jpksTTJIrwdDgbEObk=' 
WHERE 
  key_id = '85c7828b692e8db878ab3952279ca1e4f4b4e9699e406f7aca2055b9704d89b3' 
  AND (
    token = 'BVAUQRfc01srSCen/dHJux417jpksTTJIrwdDgbEObk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035