UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'jRiJkUra3+aGpPkSTXckFUGW6QwMuyF1Sc4MjqZDnyw=' 
WHERE 
  key_id = '707b5c4546f1d7430a6ddca9d080e4a062b0020b3f930172b4f1e19b5558fee4' 
  AND (
    token = 'jRiJkUra3+aGpPkSTXckFUGW6QwMuyF1Sc4MjqZDnyw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024