UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'HwVUEDvUlHvVHk+lVjgXrkgRA6m2hR6sN+oOKRIP+48='
WHERE
key_id = '9ee783b8c295b1a565a4953aa74c4f090ee2e7910582798c3815b3c17874d7d0'
AND (
token = 'HwVUEDvUlHvVHk+lVjgXrkgRA6m2hR6sN+oOKRIP+48='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)