UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'MxRvuZuYRabL2Chf4Yt5sCIAs6RRi3gFMCFKkoZHu8E='
WHERE
key_id = '91c268dc0a791e428c9ba5160928724c1af69b72bdb4e5b84a743265749077d0'
AND (
token = 'MxRvuZuYRabL2Chf4Yt5sCIAs6RRi3gFMCFKkoZHu8E='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)