UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '0y56xNVNmUOjLcd5zI1WE93f8zwRtKolBHVMfytfZPk='
WHERE
key_id = '1fb9bddd2414f731d604637c7d1f6a168a17fb037210d34a5e2762efe7ad8b04'
AND (
token = '0y56xNVNmUOjLcd5zI1WE93f8zwRtKolBHVMfytfZPk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)