UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ZEnllCPos5ugudqh1mC9PKQUQFS3vb+7WdphikiBBnQ='
WHERE
key_id = 'f199cc811ea9042acd09da5f8427895635b58400f030c2b961e223e8f6f4f64e'
AND (
token = 'ZEnllCPos5ugudqh1mC9PKQUQFS3vb+7WdphikiBBnQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)