UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'qHvzHQ+N3IDCqTtwVhgGHPWZYl3tnIvlO3dZSt6Fi6c='
WHERE
key_id = '2c9d8b486c7baf683e2e227d48b1bd5f02387709bd82b1b5ac62be94d3ca3c7e'
AND (
token = 'qHvzHQ+N3IDCqTtwVhgGHPWZYl3tnIvlO3dZSt6Fi6c='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)