UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'QMULZ7fCuK/ttWjzFfFrmHPxJZ5mi1eAAyaagVcAQR8='
WHERE
key_id = '54ecf249495f6b0fe4e18535434b914423482f3bcab9983ae60f65e861917378'
AND (
token = 'QMULZ7fCuK/ttWjzFfFrmHPxJZ5mi1eAAyaagVcAQR8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)