UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '0I6p9Y+59G7Y9ocOW2MHkJAhqqB9MhZNSzTxMBYEWnQ='
WHERE
key_id = 'eef20b3124ec01d9e5ebde06933942bc31d067a96b489f517bf94a0c9eb85a4b'
AND (
token = '0I6p9Y+59G7Y9ocOW2MHkJAhqqB9MhZNSzTxMBYEWnQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)