UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'HGa4RWcnCXP6bu/MEkzlAxKe+XF92OGEimqdLJGk3/U='
WHERE
key_id = '5b9d888a765db63e980da8b55e6aba7a84bd169155320781e3bd90d958fe8bd8'
AND (
token = 'HGa4RWcnCXP6bu/MEkzlAxKe+XF92OGEimqdLJGk3/U='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)