UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'UUQu32eznmnHf+0TMDT6PpTmbMYi7hEGWgMBgC444GY='
WHERE
key_id = '9c493b9b0346d157d40c05e46bc4e50f23cff66d7d3c677c7b26c22b5153d68f'
AND (
token = 'UUQu32eznmnHf+0TMDT6PpTmbMYi7hEGWgMBgC444GY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)