UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'EtHTTgUvS8c0Mfv0aNAuK3DYSzl3E67g2WlbOl+GZd0='
WHERE
key_id = 'd0225bf4b37a6ce31bb1b7c512fb7f26cf643c7bfdde23576b60b228467d9f3a'
AND (
token = 'EtHTTgUvS8c0Mfv0aNAuK3DYSzl3E67g2WlbOl+GZd0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)