UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'w3qAcdJnNZXbCLkQNjqV7wvTy7Ok7wMlMasR8xHSMyw=' 
WHERE 
  key_id = '2c17c94f131d3ddc3d3807bc8e21db24ada7f30dc16d099b8c5a05b5d3334b22' 
  AND (
    token = 'w3qAcdJnNZXbCLkQNjqV7wvTy7Ok7wMlMasR8xHSMyw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00042