UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'poNB2nna5SoXIjtqNENVSuwE/9bmyvyT+1Zi02AteBo='
WHERE
key_id = '6944911e6395b91545703a3a0ffa0bd533c63f576d550aca92d88d8e3b24ab54'
AND (
token = 'poNB2nna5SoXIjtqNENVSuwE/9bmyvyT+1Zi02AteBo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)