UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '9Anwin77486fsS281SJeV7ABNt602gvrYlDSOyIzWEk='
WHERE
key_id = 'af54376260cce36337da875f9aecc1ad153061fed4604fff6c4c4d5d0c5774aa'
AND (
token = '9Anwin77486fsS281SJeV7ABNt602gvrYlDSOyIzWEk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)