UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'tK4beKk0XHHx4/lm3/2Hnf0+HeJL0eqgr/vmKKaDf1o='
WHERE
key_id = 'f6293f10d1bb920ec663d6c6611ffb75f355682847340164617868b9b3fa67f1'
AND (
token = 'tK4beKk0XHHx4/lm3/2Hnf0+HeJL0eqgr/vmKKaDf1o='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)