UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Lvvsvy//pMCuX3kZYp2oxVGWIPD3aewuIGqUXcUcLGg='
WHERE
key_id = 'a88dd2d96c51a86f0aa6fa1f544c67a55d68614a1080e7a99f7d9f4ddf8a1041'
AND (
token = 'Lvvsvy//pMCuX3kZYp2oxVGWIPD3aewuIGqUXcUcLGg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)