UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'gNOixzo/Bf4lsOdYg6J6OdYS/se3QfMYmEhdDr1ROKY='
WHERE
key_id = '8b522e448f7e07370e31dbfd1c5b4c2c4f18e7bb20a50c29e6d67a320f5f914f'
AND (
token = 'gNOixzo/Bf4lsOdYg6J6OdYS/se3QfMYmEhdDr1ROKY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)