UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'qdAizMeISnp8WLvYmZGKraFqM+1Pf+rmdgBpTUhwOq0='
WHERE
key_id = '429839de1e96cddc3ea80c120892ecd0c8f49be1fe67a71a65c0afe83a58aa56'
AND (
token = 'qdAizMeISnp8WLvYmZGKraFqM+1Pf+rmdgBpTUhwOq0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)