UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'LubmYtEkInhupyKwC7wxoXWINz66qkd8FEauD3tX6qw=' 
WHERE 
  key_id = 'd0f00e7433d12fcded71aa2797e22ad5b3dbd8718ac480c51a03b908eac96ed6' 
  AND (
    token = 'LubmYtEkInhupyKwC7wxoXWINz66qkd8FEauD3tX6qw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00062