UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'llcbL4IeWo5jqcmg7dAYlyGFETxpI/3UkgMlZNnV5pA=' 
WHERE 
  key_id = 'dcf732dbe448ebf0ac267f8750ad40e472c88a3d41e13584ce8c646cdbbaa157' 
  AND (
    token = 'llcbL4IeWo5jqcmg7dAYlyGFETxpI/3UkgMlZNnV5pA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032