UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'pyy+QHv64lIfRTCF1QdzCV73dQjD4FVsLN5ELgS4uYg=' 
WHERE 
  key_id = '84cb80abd75dede59b5081a8c3320c5b14ece599a4a7bdd94b1e4d593042c94c' 
  AND (
    token = 'pyy+QHv64lIfRTCF1QdzCV73dQjD4FVsLN5ELgS4uYg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00043