UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'NVpIYHG3gr96Vu54f0XAH7Rv9CppylbysvtH4X8mJjw=' 
WHERE 
  key_id = '199461cdc49e1851e1f026b4d46644b0bf485a2afb2e125bed31f09b89e639dd' 
  AND (
    token = 'NVpIYHG3gr96Vu54f0XAH7Rv9CppylbysvtH4X8mJjw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00040