UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'JFaXzED9ozFI8R6dj/ZLvP5BmPLh/AspRBf/bjxAj+c='
WHERE
key_id = '8858a12602e6cb38d623d4ebfa6542e2bcd1cb855609a15f4606501c55f51190'
AND (
token = 'JFaXzED9ozFI8R6dj/ZLvP5BmPLh/AspRBf/bjxAj+c='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)