UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '9XOxah+7JYEmZZZqr34/CTe4n2lVgEXRaObRIZxOwQo=' 
WHERE 
  key_id = 'e896eef257982e7ca59dc40604182e03f53b581b33bb81f487dea0139c91ac16' 
  AND (
    token = '9XOxah+7JYEmZZZqr34/CTe4n2lVgEXRaObRIZxOwQo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021