UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'k9j+SvQJrHtqMdVOlEG22/i7HtFYNdpvs78g0OuLce0='
WHERE
key_id = '1506d80cb231e6e42d1bae6cb50e4c2c0a8fd10a1cd658d388ad1b18da5ff4fc'
AND (
token = 'k9j+SvQJrHtqMdVOlEG22/i7HtFYNdpvs78g0OuLce0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)