UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'P/K/j9dxs29/PrsG5PrDJjyahZEQvbUJE+SEXewlmtY=' 
WHERE 
  key_id = 'f8a502939c27b8facb6ba4d7015e4741e978b8365cf97f14f2356686dd43c578' 
  AND (
    token = 'P/K/j9dxs29/PrsG5PrDJjyahZEQvbUJE+SEXewlmtY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00015