UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '8KQkwrPbUapaYzs5DIkXf+IF3Fqmx7864iyl7E1QJFU='
WHERE
key_id = '1cb4774e676625e775c65f63ce0eb0f09ed17e5614f51f32920cdf1b7025dabd'
AND (
token = '8KQkwrPbUapaYzs5DIkXf+IF3Fqmx7864iyl7E1QJFU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)