UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'PzM1Ama6wOjTPAg2PuEyknbs8a2NBXVCqKJoBhXXQGw=' 
WHERE 
  key_id = '47fbd47accabca19a63618955f0ce4449ab807efd737db42e14fd5d510098da0' 
  AND (
    token = 'PzM1Ama6wOjTPAg2PuEyknbs8a2NBXVCqKJoBhXXQGw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032