UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Zd995bAMk+emwWoDTk8hj1lm2phEJK5Y3htfS5O2DoE='
WHERE
key_id = '0413acf4cd4c9b831c3c2c1c800157c5e4a4341ff1bb0c3f88afb62eb3b5f1cc'
AND (
token = 'Zd995bAMk+emwWoDTk8hj1lm2phEJK5Y3htfS5O2DoE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)