UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '14lCjWkdDLsHk3eB7cwoaF+oDBWnFg23LbzkhvU9l2s='
WHERE
key_id = 'f2115c81185af9959c19b617a2dfb7bacfc524daa37d68f821692ccdc308ea02'
AND (
token = '14lCjWkdDLsHk3eB7cwoaF+oDBWnFg23LbzkhvU9l2s='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)