UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '6lvXLCELGwfEcx/96NuOhghlOxE5y2QGHkBvN3cZu8o=' 
WHERE 
  key_id = '700939673ad06d513e253c6e97810a9c7388f4d77e6fafb51527f9a02c512074' 
  AND (
    token = '6lvXLCELGwfEcx/96NuOhghlOxE5y2QGHkBvN3cZu8o=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033