UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'yunn8Kh6Blm+Yqxgk54xqUXQIewRuN5YhUWNblNa6Bc='
WHERE
key_id = '5f01758b599033c0e899e871d25fcbbb716559a6f488f4a790d9ee98613843b8'
AND (
token = 'yunn8Kh6Blm+Yqxgk54xqUXQIewRuN5YhUWNblNa6Bc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)