UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'JiYUDEIuyXs4YflpfvMoNhsuwxZTNGICDTRBHWvyCqY='
WHERE
key_id = 'a694ebc0d9d0cde30e63ab1ede21e0f2c44b2dabfb9fa3d34def7031785357c9'
AND (
token = 'JiYUDEIuyXs4YflpfvMoNhsuwxZTNGICDTRBHWvyCqY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)