UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'c0f96x9f/o/XVdZYsp1E6S4ERlREY1Gr94Ueqls12WM=' 
WHERE 
  key_id = '1c5efe96e03253f1541b573e44b51ff670de14ef12b6caeef07556c890e8abea' 
  AND (
    token = 'c0f96x9f/o/XVdZYsp1E6S4ERlREY1Gr94Ueqls12WM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00014