UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'xslz5Kt4nZRHgjlguNdayeJfjvmigX0lMgZ9NUSRcVM='
WHERE
key_id = '59cb8e2770cdfec0d5bcf75bc7e9bcb8251a8e3723c1f831b8e9548baafe1e9c'
AND (
token = 'xslz5Kt4nZRHgjlguNdayeJfjvmigX0lMgZ9NUSRcVM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)