UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '37FdQpFTtf/5LxxSMr2OiEQyndp/xXbroVaACUhqT90=' 
WHERE 
  key_id = 'a84c25764e7db168104f25fb913833c2747a521921db66ee5c07f059d9acac5b' 
  AND (
    token = '37FdQpFTtf/5LxxSMr2OiEQyndp/xXbroVaACUhqT90=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038