UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '6X6YF3QCK0VPnaCOHqBGAbFNJO895BQ1vSTtHvErmic=' 
WHERE 
  key_id = '99b399fcdb8f2ae85957005278269f928cac1b12dc51f512dde1a431db2e4ebc' 
  AND (
    token = '6X6YF3QCK0VPnaCOHqBGAbFNJO895BQ1vSTtHvErmic=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00043