UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '60Fw4LqM1UO3T73+m78IvUlUAGFeQHIxPZXPFQo8F54=' 
WHERE 
  key_id = '637e3a24b2f5fd2cb4bdd23f8655ec97e53cecf6e31cf68d1e16ef38a3eb826e' 
  AND (
    token = '60Fw4LqM1UO3T73+m78IvUlUAGFeQHIxPZXPFQo8F54=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034