UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'gtyt/Ql9a5ZMOG89mGvzxk5ICTZIY7onSQAHvrsXskU=' 
WHERE 
  key_id = '9aab6cbdb906a8d2ed43ba45ba8cf25c43da5d588865c7ef3796b809daad5ead' 
  AND (
    token = 'gtyt/Ql9a5ZMOG89mGvzxk5ICTZIY7onSQAHvrsXskU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00023