UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'lMCg31HeYCRJZ0kb9Gs5IX5ka48SXKpjzb8mAmmt/9g=' 
WHERE 
  key_id = 'e1b8c90d6673cfb77fa0e1dc069ab017eb8dc510c7a605d5d2578389ac88410b' 
  AND (
    token = 'lMCg31HeYCRJZ0kb9Gs5IX5ka48SXKpjzb8mAmmt/9g=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027