UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'VgB3v1jFhFmpXIU3ptQQle1ddRdlJfSSLBP/TprPBzs=' 
WHERE 
  key_id = '36cc2468c9c3923d331b77e5962467bf5d43d7e168e275d90807e9176f6f838f' 
  AND (
    token = 'VgB3v1jFhFmpXIU3ptQQle1ddRdlJfSSLBP/TprPBzs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029