UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'mxGcXE6egJ8OoIKJyMY17Kx3zZ3vYQahFnphYB4nXPg='
WHERE
key_id = '939b9bbbe08453de430dcf92dbba1b97d5dfcf0652910a536a19d171b93532c5'
AND (
token = 'mxGcXE6egJ8OoIKJyMY17Kx3zZ3vYQahFnphYB4nXPg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)