UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'anbbNMCXV/GO51Od3+4MiKtxvqnL/xt0Us4JqRhD1B4='
WHERE
key_id = '31c6012019cb42c3df96ad12158f9124f7ad038e56b6a22ee5b67db83e9eedee'
AND (
token = 'anbbNMCXV/GO51Od3+4MiKtxvqnL/xt0Us4JqRhD1B4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)