UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '6h+sWv14orS3tqkW3TikBEl1yaoMiCK++LX7LYaZsJs=' 
WHERE 
  key_id = '82198b612199126c8e72c7714c00c488de26dad5d74d9b25461ee39ddc4a2c09' 
  AND (
    token = '6h+sWv14orS3tqkW3TikBEl1yaoMiCK++LX7LYaZsJs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00058