UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'w4vQEiehb9VP4raM/3vs5d4sWVF2cp/XcfN9EWeiY9g=' 
WHERE 
  key_id = '1fb31d01b4682766918cb03046d34df87fb433dd5d61699c3737fce965adb203' 
  AND (
    token = 'w4vQEiehb9VP4raM/3vs5d4sWVF2cp/XcfN9EWeiY9g=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022