UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '4AJ/kTjblb1k0JXW+Rmf8Jd+ZQhp0lR53saZmNGbuqA=' 
WHERE 
  key_id = '4121791aa436fedd31cb3ae5f3726c893bb7d0e8ae1e657eb7c70a2accd5e499' 
  AND (
    token = '4AJ/kTjblb1k0JXW+Rmf8Jd+ZQhp0lR53saZmNGbuqA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017