UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'x1bvV9gD5b/gnMWvqV1MuWiHYmb/Z38I0UQuqTlJlFk=' 
WHERE 
  key_id = 'a5bcbc0d62ac5d508a57bbe2d86b8aa221763625ff017881075d43f8a68c2a06' 
  AND (
    token = 'x1bvV9gD5b/gnMWvqV1MuWiHYmb/Z38I0UQuqTlJlFk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00020