UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ZWs5qWzFOyWKuH6snmmc0nefqS+b2VmJz/9vlDtikR0='
WHERE
key_id = '809695d6d6f10a463cb11316c7ca80bdb4dfccfc34a35580bbdabab5dcb0c830'
AND (
token = 'ZWs5qWzFOyWKuH6snmmc0nefqS+b2VmJz/9vlDtikR0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)