UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '14dC8gKeR4DKzb+YNVjetNjNAQ7UWAEs/YsABkqLasM='
WHERE
key_id = 'ea9be7f89defa11e85b79cf779a1022b92f0ab202c1d448949b2f40e804fba3f'
AND (
token = '14dC8gKeR4DKzb+YNVjetNjNAQ7UWAEs/YsABkqLasM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)