UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'taXe3owfzxO+PM7U5CsfRwG+D8ON4PfI0DNMXxNhMQM='
WHERE
key_id = '302ab12f0ecdf1042a6c8c5146968054788149f89515ba49afc0433052f7872d'
AND (
token = 'taXe3owfzxO+PM7U5CsfRwG+D8ON4PfI0DNMXxNhMQM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)