UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'OyEfCK+TSlpP/IczcDc4EXG2rQuKtUg16ZJvv6umHQU='
WHERE
key_id = '27209317ee34d9e101cbe355e06ab1e8017768039e3e02541ed21d4821136dc2'
AND (
token = 'OyEfCK+TSlpP/IczcDc4EXG2rQuKtUg16ZJvv6umHQU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)