UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'yE0rAkW5HdthBAFrZykSgpf2t1h03HRaP0V4sQkkKpc='
WHERE
key_id = 'adb6e708f1dbc4948d4d053319794f529312b74eae60c5ec5534e2f30192364e'
AND (
token = 'yE0rAkW5HdthBAFrZykSgpf2t1h03HRaP0V4sQkkKpc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)