UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'hcRPHbkfkLlWhK9jaFka9AdbmqSv1/dxOhhYNqj2PgY=' 
WHERE 
  key_id = '6841abd4e45a1e6ea400b87291e9437bfd5bea40535200eb0a608016e2eca953' 
  AND (
    token = 'hcRPHbkfkLlWhK9jaFka9AdbmqSv1/dxOhhYNqj2PgY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031