UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'F9x5IVA1x5LgLqLT0qwsZyqkIttdien317OxEP4mQPw=' 
WHERE 
  key_id = 'e13b98f72c78459f32b0a60fc8798c8e9f257d86bc8242c1b133eb7eb06c926d' 
  AND (
    token = 'F9x5IVA1x5LgLqLT0qwsZyqkIttdien317OxEP4mQPw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029